<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>仿站电商平台</title>
  <!-- 引入swiper文件 -->
  <link rel="stylesheet" href="./lib/swiper/swiper-bundle.min.css">
  <style>
    * {
      margin: 0 auto;
      padding: 0;
    }

    h1 {
      width: 80%;
      height: 80px;
      background-color: skyblue;
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      color: white;
    }

    h1>p {
      font-size: 20px;
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      right: 50px;
      display: none;
      
    }

    h1>p.active {
      display: block;
    }
    
    h1>p>button {

      padding: 4px 8px;
      border: none;
      border-radius: 5px;
      background-color: #fff;
      color: #000;
      cursor: pointer;
      font-size: 14px;
      
    }
    /* 轮播图大小控制 */
    .relay {
      height: 800px;
      width: 80%;
      background-color: pink;
    }

    
    html,
    body {
      position: relative;
      height: 100%;
    }

    body {
      background: #eee;
      font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
      font-size: 14px;
      color: #000;
      margin: 0;
      padding: 0;
    }

    .swiper {
      width: 100%;
      height: 100%;
    }

    .swiper-slide {
      text-align: center;
      font-size: 18px;
      background: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .swiper-slide img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  </style>
  <style type="text/css">
    .swiper {
      /* --swiper-theme-color: #ff6600;设置Swiper风格 */
      --swiper-navigation-color: #dae9e8;
      /* 单独设置按钮颜色 */
      --swiper-navigation-size: 100px;
      /* 设置按钮大小 */
    }
    a{
      color: #000;
      text-decoration: none;
    }
    
  </style>
</head>

<body>

  <h1>
    首页
    <p class="off "><a href="./login.html">您好, 请登录</a></p>
    <p class="on active">您好, <span class="nickname">leon</span>
      <button class="self">个人中心</button>
      <button class="logout">退出登录</button>
    </p>
      
  </h1>
  <!-- 购买商品 -->
  <div style="font-size: 50px; font-weight: 700;text-align: center;margin:8px;"><a href="./list.html">购买商品</a></div>
  <script src="./js/axios.min.js"></script>
  <script src="./js/http.js"></script>
  <script src="./js/index.js"></script>
  <!-- 下面是轮播图功能 -->
  <div class="relay">
    <div class="swiper mySwiper">
      <div class="swiper-wrapper">
        <div class="swiper-slide"><img src="./img/img1.jpg" alt=""></div>
        <div class="swiper-slide"><img src="./img/img2.jpg" alt=""></div>
        <div class="swiper-slide"><img src="./img/img3.jpg" alt=""></div>
        <div class="swiper-slide"><img src="./img/img4.jpg" alt=""></div>
        <div class="swiper-slide"><img src="./img/img5.jpg" alt=""></div>
      </div>
      <div class="swiper-button-prev"></div><!--左箭头。如果放置在swiper外面，需要自定义样式。-->
      <div class="swiper-button-next"></div><!--右箭头。如果放置在swiper外面，需要自定义样式。-->
      <div class="swiper-pagination"></div>
    </div>
  </div>
  <!-- 引入swiper的js部分 -->
  <!-- 首页轮播图功能 -->
  <script src="./lib/swiper/swiper-bundle.min.js"></script>
  <script>
  var swiper = new Swiper(".mySwiper", {
    pagination: {
      el: ".swiper-pagination",
    },
    autoplay: {
      delay: 1000,//1秒切换一次
      pauseOnMouseEnter: true,
    },//鼠标经过停止自动播放
    navigation: {
      nextEl: '.swiper-button-next',
      prevEl: '.swiper-button-prev',
    },
  });</script>
</body>

</html>